package com.xingu.xg.mapper;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
import com.xingu.xg.dal.domain.Category1;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Collection;
import java.util.List;

@Mapper
public interface Category1Mapper extends BaseMapper<Category1> {


    default List<Category1> selectByParentId( Collection<Long> parentIds ){
        return selectList( new LambdaQueryWrapper<Category1>().in(Category1::getPid ,parentIds));
    }


    default List<Category1> selectByParentId( Long parentId ){
        return selectList( new LambdaQueryWrapper<Category1>().eq(Category1::getPid ,parentId));
    }



}
